<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use app\modules\clinical\models\ExcelUdprs;

/* @var $this yii\web\View */
/* @var $model app\models\ExcelRdprs */
/* @var $form yii\widgets\ActiveForm */
$index_param = 1;

$options = ['yanyu' => '言语(表达)','mianbu' => '面部表情', 'zhenc_jz' => '静止性震颤', 'zhenc_shou' => '手部动作性或姿势性震颤', 'qiangz' => '强直(患者取坐位,放松,以大关节的被动活动来判断,可以忽略“齿轮样感觉”)', 'paida' => '手指拍打试验(拇食指尽可能大幅度、快速地做连续对掌动作)', 'yund' => '手运动(尽可能大幅度地做快速连续的伸掌握拳动作,两手分别做)', 'lunti' => '轮替动作(两手垂直或水平作最大幅度的旋前和旋后动作,双手同时动作)', 'tui' => '腿部灵活性(连续快速地脚后跟踏地,腿完全抬高,幅度约为3英寸)', 'qili' => '起立(患者双手臂抱胸从直背木或金属椅子站起)', 'zishi' => '姿势', 'butai' => '步态', 'zishi_w' => '姿势的稳定性(突然向后拉双肩时所引起姿势反应?患者应睁眼直立?双脚略分开并做好准备)', 'quti' => '躯体少动(梳头缓慢,手臂摆动减少,幅度减小,整体活动减少)'];

$detail_zhenc_jz = ['mian' => '面部', 'zui' => '嘴唇', 'xe' => '下颌', 'ru' => '右上肢', 'lu' => '左上肢', 'rd' => '右下肢', 'ld' => '左下肢'];
$detail_zhenc_shou = ['ru' => '右上肢', 'lu' => '左上肢'];
$detail_qiangz = ['j' => '颈', 'ru' => '右上肢', 'lu' => '左上肢', 'rd' => '右下肢', 'ld' => '左下肢'];
$detail_paida = ['l' => '左手', 'r' => '右手'];
$detail_yund = ['l' => '左手', 'r' => '右手'];
$detail_tui = ['l' => '左侧', 'r' => '右侧'];
?>

<div class="form-group">
    <?= Html::label('患者姓名', 'pt_rel') ?><br />
    <?= Html::dropDownList('pt_rel', (!empty($pt_rel)) ? $pt_rel : 0, $pt_rel_list, ($model->isNewRecord) ? ['class' => 'pt_rel_list'] : ['class' => 'pt_rel_list', 'disabled' => 'true']) ?>
</div>
<div class="form-group">
    <?= Html::label('评估时间', 'evaluation_time') ?><br />
    <?= Html::textInput('evaluation_time', empty($evaluation_time) ? '' : $evaluation_time, ['class'=>'form-control laydate-icon date']) ?>
</div><br />

<?= $form->field($model, 'med_time_off')->textInput(['class'=>'form-control laydate-icon time'])->error(false) ?>

<?= $form->field($model, 'mdb_amount')->textInput()->error(false) ?>

<?= $form->field($model, 'med_time_on')->textInput(['class'=>'form-control laydate-icon time'])->error(false) ?><br /><br />


<table class="table">
    <?php foreach ($options as $key => $option) : ?>
    <tr>
        <td width="380px">
            <b><?= $index_param ++ .'. '. $option ?></b>
            <?php $count = 0; ?>
            <?php foreach (ExcelUdprs::getParams(($key == 'lunti' || $key == 'tui') ? 'yund' : $key) as $standard) : ?>
                <br /><?= $count ++.' = '.$standard ?>
            <?php endforeach; ?>
        </td>
        <td>
            <?php $detailName = 'detail_'.$key; if (isset($$detailName)) : ?>
            <?php foreach ($$detailName as $detail_en => $detail_ch) : ?>
            <b><?= $detail_ch ?>:</b><br />
            OFF: <?= $form->field($model, $key.'_'.$detail_en.'_off')->label(false)->listBox(['0', '1', '2', '3', '4'])->error(false) ?>
            ON: <?= $form->field($model, $key.'_'.$detail_en.'_on')->label(false)->listBox(['0', '1', '2', '3', '4'])->error(false) ?><br /><br />
            <?php endforeach; ?>
            <?php else : ?>
            OFF: <?= $form->field($model, $key.'_off')->label(false)->listBox(['0', '1', '2', '3', '4'])->error(false) ?>
            ON: <?= $form->field($model, $key.'_on')->label(false)->listBox(['0', '1', '2', '3', '4'])->error(false) ?>
            <?php endif; ?>
        </td>
    </tr>
    <?php endforeach; ?>
    <tr>
        <td>
            <b>Hoehn&Yahr病情分级</b>
            <?php foreach (ExcelUdprs::getParams('hoehn') as $key => $standard) : ?>
                <br /><?= $key.'期 = '.$standard ?>
            <?php endforeach; ?>
        </td>
        <td>
            分级: <?= $form->field($model, 'hoehn')->label(false)->listBox(['0' => '0', '1' => '1', '1.5' => '1.5', '2' => '2', '2.5' => '2.5', '3' => '3', '4' => '4', '5' => '5'])->error(false) ?>
        </td>
    </tr>
</table>

<h4>
    <span>OFF得分:<span id="offScore">0</span></span>
    <span>ON得分:<span id="onScore">0</span></span>
    <span>改善率:<span id="totalScore">0</span>%</span>
</h4><br />
